package com.deep.spring.v19;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

@Component
public class TestConfig implements InitializingBean {

    public TestConfig() {
        System.out.println("TestConfig construce " + this.getClass().getSimpleName());
    }

    @PostConstruct
    public void post() {
        System.out.println("TestConfig PostConstruct " + this.getClass().getSimpleName());
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("TestConfig afterPropertiesSet" + this.getClass().getSimpleName());
    }

    @RountingInjected(value = "com.deep.spring.v19.CustomizeServiceImpl1")
    CustomizeService1 customizeServiceImpl1;

    @RountingInjected(value = "com.deep.spring.v19.CustomizeServiceImpl2")
    CustomizeService1 customizeServiceImpl2;

    @RountingInjected(value = "com.deep.spring.v19.CustomizeServiceImpl3")
    CustomizeService1 customizeServiceImpl3;

    public void test() {
        System.out.println("aaaaaaaaaa");
        customizeServiceImpl1.execute();
        customizeServiceImpl2.execute();
        customizeServiceImpl3.execute();
    }
}
